package aop_anno;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import aop_anno.MessageBean ;

public class HelloApp {

	public static void main(String[] args) {

		ApplicationContext factory = new ClassPathXmlApplicationContext("aop_anno/beans.xml");
		MessageBean bean = (MessageBean)factory.getBean("targetBean");
		
		/*MessageBean bean = (MessageBean) factory.getBean("targetBean");*/
		System.out.println("around advice.....................................................");
		bean.sayHelloAround();

		System.out.println("before advice......................................................");
		bean.sayHelloBefore();

		System.out.println("after advice.............................................................");
		bean.sayHelloAfter();
		/*
		 * public static void main(String[] args){ ApplicationContext factory =
		 * new ClassPathXmlApplicationContext("aop_aspect/beans.xml");
		 * 
		 * ClassPathXmlApplicationContext --> import
		 * org.springframework.context.support.ClassPathXmlApplicationContext; 도
		 * 자동완성으로 추가해준다.. }
		 */
	}
}
